package com.github.boluo1230.wechat.entity.message;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class WxCustomImage implements WxCustomMsg, Serializable {
    @JsonProperty(value = "touser")
    private String toUser;

    @JsonProperty(value = "msgtype")
    private String msgType = "image";

    @JsonProperty(value = "image")
    private WxCustomImage.Image image;

    public WxCustomImage(String openId, String content) {
        this.setToUser(openId);
        this.setImage(new WxCustomImage.Image(content));
    }

    @Setter
    @Getter
    public class Image {
        @JsonProperty(value = "media_id")
        private String mediaId;

        public Image(String mediaId) {
            this.setMediaId(mediaId);
        }
    }
}
